<?php

/**
 * 抽象类， 使用关键字 abstract 定义
 */
abstract class Test {
    public function say ()
    {
        echo 123;
    }

    // 抽象方法
    abstract public function eat ($food);
}

//new Test(); // Fatal error: Cannot instantiate abstract class Test 抽象类不能实例化，只能被继承

class Test2 extends Test {
    public function eat($food )
    {
        echo 'eat';
    }
}

$obj = new Test2();
$obj->say();

/*
 *  mysql oracle 。。。
 * */

abstract  class DB {
    abstract public function __construct ($host , $usr , $password , $port=3306);
    abstract public function insert ($table , $data);
    abstract public function delete ($id);
    abstract public function update ($table , $data , $where);
}

class Mysql extends DB {
    function __construct($host, $usr, $password, $port = 3306)
    {
//        mysqli_connect($host , ...);
    }
    function insert($table, $data)
    {
        $sql = 'IN';
        // TODO: Implement insert() method.
    }
}




